package com.ai.cltcore.control;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ai.frame.logger.Logger;
import com.ai.frame.logger.LoggerFactory;
import com.ai.cltcore.util.DedicException;
 
public class FupinCoreProvider {
	private static final Logger LOGGER = LoggerFactory
			.getApplicationLog(FupinCoreProvider.class);
	private FupinCoreProvider(){}
    public static void main(String[] args) throws DedicException {
    	try{
    		String dubboCfg=System.getProperty("dubbo_cfg");
    		if(dubboCfg==null||"".equals(dubboCfg)){
    			throw new DedicException("请配置dubbo_cfg参数!");
    		}
        	ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring/spring-all.xml",dubboCfg});
    		context.start();
            synchronized (FupinCoreProvider.class) {
                while(true){
                	FupinCoreProvider.class.wait();
                	break;
                }
            }
    	}catch(Exception e){
    		LOGGER.error("FupinCoreProvider", "", e);
    	}
    }
    
}
 